/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.ccut.titan.component;

import java.util.List;

/**
 * Logic context, deposit date in logic process each node used
 * 
 * @author LeslieGu
 */
public interface ILogicContext {

	/**
	 * Get logic context unique Id
	 * 
	 * @return
	 */
	public String getId();

	/**
	 * Get value object by key
	 * 
	 * @param key
	 * @return
	 */
	public Object getValue(String key);

	/**
	 * Get value object by {@link IParameter}
	 * 
	 * @param parameterContext
	 * @return
	 */
	public Object getValue(IParameterInfo parameterInfo);

	/**
	 * Set value object
	 * 
	 * @param key
	 * @param value
	 */
	public void setValue(String key, Object value);

	/**
	 * Set value object by parameter
	 * 
	 * @param parameterInfo
	 */
	public void setValue(IParameterInfo parameterInfo, Object value);

	/**
	 * Create a {@link IParameterContext} by parameter List
	 * 
	 * @param parameterInfo
	 * @return
	 */
	public IParameterContext createParameterContext(
			List<IParameterInfo> parameterInfos);

	/**
	 * Refresh logic context by parameterInfo List
	 * 
	 * @param parameterContext
	 */
	public void refreshContextFromParameterContext(
			List<IParameterInfo> parameterInfos,
			IParameterContext parameterContext);
}
